<?php

	class ReportageModel extends EbTableSQLModel
	{

		public function __construct()
		{
			parent::init('vp_reportages','VarPeople/ReportageVO','rep_id');
		}
		
		public function getColumns()
		{
			return array(
				new EbTableColumn('rep_id','INT',true,1,false),
				new EbTableColumn('nom','VARCHAR(32)',true,0,false),
				new EbTableColumn('description','TEXT',true,0,false),
				new EbTableColumn('urlname','varchar(128)',true,EB_UNIQUE_KEY),
				new EbTableColumn('date','DATETIME',true,0,false),
				new EbTableColumn('ville','VARCHAR(32)',true,0,false)
			);
		}
		
		public function selectListing()
		{
			$buffer = $this->select();
			
			foreach($buffer AS $item)
			{
				$item->url = '/reportages/'.$item->urlname;
			}
			
			return $buffer;
		}
		
	}